import request from '@/utils/request'

// 查询课程信息列表
export function listSchedule(query) {
  return request({
    url: '/system/center/list',
    method: 'get',
    params: query
  })
}

// 查询课程信息详细
export function getSchedule(courseId) {
  return request({
    url: '/system/center/' + courseId,
    method: 'get'
  })
}

// 新增课程信息
export function addSchedule(data) {
  return request({
    url: '/system/center',
    method: 'post',
    data: data
  })
}

// 修改课程信息
export function updateSchedule(data) {
  return request({
    url: '/system/center',
    method: 'put',
    data: data
  })
}

// 删除课程信息
export function delSchedule(courseId) {
  return request({
    url: '/system/center/' + courseId,
    method: 'delete'
  })
}

// 选课
export function selectCourse(data) {
  return request({
    url: '/system/center/select',
    method: 'post',
    data: data
  })
}

// 退选
export function cancelCourse(data) {
  return request({
    url: '/system/center/cancel',
    method: 'post',
    data: data
  })
}